﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBMigrator.Core.DbObjects.Data.What;
using Xunit;

namespace DBMigrator.Core.Tests.DbObjects.Data
{
    public class WhatColumnTests
    {
        [Fact]
        public void ConstructorShouldThrowIfColumnNameIsNull()
        {
            Assert.Throws<ArgumentNullException>(() => new WhatColumn("TableName", null));
        }

        [Fact]
        public void ConstructorShouldThrowIfColumnNameIsEmpty()
        {
            Assert.Throws<ArgumentNullException>(() => new WhatColumn("TableName", string.Empty));
        }

        [Fact]
        public void ConstructorShouldSetColumnName()
        {
            var columnName = StringUtil.Random();
            Assert.Equal(columnName, new WhatColumn("TableName", columnName).ColumnName);
        }
    }
}
